﻿using System;
using System.Collections.Generic;
using TrainSimulator.Interfaces.DataGridView;

namespace TrainSimulator.Interfaces
{
    public delegate void TrainChangeHandler(ITrain train, ITrainEventArgs e);
    public delegate void ReverseHandler(ITrain train, ITrainEventArgs e);
    public delegate void TrackHandler(ITrain train, ITrainEventArgs e);

    public interface ITrainEventArgs : IEventArgs
    {
        ITrain TrainSet { get; }
        Object OldValue { get; }
        Object NewValue { get; }
    }

    public interface ITrain : IDgvTrain
    {
        event TrainChangeHandler OnChange;
        event ReverseHandler OnReverse;
        event TrackHandler OnTrack;

        int ID { get; }
        new double RequestedSpeed { get; set; }
        double Speed { get; set; }
        ILocoDriver LocoDriver { get; set; }
        ITrainEngine Engine { get; set; }

        IState CurrentState { get; set; }
        IState PreviousState { get; set; }
        string WagonsInfo { get; }
        List<IWagon> Wagons { get; }
        double Length { get; }
        bool Reverse { get; set; }
        ITrack CurrentTrack { get; set; }

        void SetState(IState state);
        void UpdateState();
        void AddWagon(IWagon wagon);
    }
}
